home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '93 / Papers '93 / Macintosh as Internet Server ƒ / inetd / talkd / U_ctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-15  |  1.1 KB  |  58 lines  |  [TEXT/MPS ]

  1. /*    @(#)ctl.h 1.1 90/03/23 SMI; from UCB 1.4 83/03/28    */
  2.  
  3. /* ctl.h describes the structure that talk and talkd pass back
  4.    and forth
  5.  */
  6.  
  7. #include <sys/types.h>
  8. #include <sys/socket.h>
  9. #include <netinet/in.h>
  10. #include <netdb.h>
  11.  
  12. #define NAME_SIZE 9
  13. #define TTY_SIZE 16
  14. #define HOST_NAME_LENGTH 256
  15.  
  16. #define MAX_LIFE 60 /* maximum time an invitation is saved by the
  17.              talk daemons */
  18. #define RING_WAIT 30  /* time to wait before refreshing invitation 
  19.              should be 10's of seconds less than MAX_LIFE */
  20.  
  21.     /* the values for type */
  22.  
  23. #define LEAVE_INVITE 0
  24. #define LOOK_UP 1
  25. #define DELETE 2
  26. #define ANNOUNCE 3
  27.  
  28.     /* the values for answer */
  29.  
  30. #define SUCCESS 0
  31. #define NOT_HERE 1
  32. #define FAILED 2
  33. #define MACHINE_UNKNOWN 3
  34. #define PERMISSION_DENIED 4
  35. #define UNKNOWN_REQUEST 5
  36.  
  37. typedef struct ctl_response CTL_RESPONSE;
  38.  
  39. struct ctl_response {
  40.     char type;
  41.     char answer;
  42.     int id_num;
  43.     struct sockaddr_in addr;
  44. };
  45.  
  46. typedef struct ctl_msg CTL_MSG;
  47.  
  48. struct ctl_msg {
  49.     char type;
  50.     char l_name[NAME_SIZE];
  51.     char r_name[NAME_SIZE];
  52.     int id_num;
  53.     int pid;
  54.     char r_tty[TTY_SIZE];
  55.     struct sockaddr_in addr;
  56.     struct sockaddr_in ctl_addr;
  57. };
  58.